# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V4.Model.BillingProfile do
  @moduledoc """
  Contains properties of a Campaign Manager Billing Profile.

  ## Attributes

  *   `consolidatedInvoice` (*type:* `boolean()`, *default:* `nil`) - Consolidated invoice option for this billing profile. Used to get a single, consolidated invoice across the chosen invoice level.
  *   `countryCode` (*type:* `String.t`, *default:* `nil`) - Country code of this billing profile.This is a read-only field.
  *   `currencyCode` (*type:* `String.t`, *default:* `nil`) - Billing currency code in ISO 4217 format.This is a read-only field.
  *   `id` (*type:* `String.t`, *default:* `nil`) - ID of this billing profile. This is a read-only, auto-generated field.
  *   `invoiceLevel` (*type:* `String.t`, *default:* `nil`) - Invoice level for this billing profile. Used to group fees into separate invoices by account, advertiser, or campaign.
  *   `isDefault` (*type:* `boolean()`, *default:* `nil`) - True if the billing profile is the account default profile. This is a read-only field.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "dfareporting#billingProfile".
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of this billing profile. This is a required field and must be less than 256 characters long and must be unique among billing profile in the same account.
  *   `paymentsAccountId` (*type:* `String.t`, *default:* `nil`) - The ID of the payment account the billing profile belongs to. This is a read-only field.
  *   `paymentsCustomerId` (*type:* `String.t`, *default:* `nil`) - The ID of the payment customer the billing profile belongs to. This is a read-only field.
  *   `purchaseOrder` (*type:* `String.t`, *default:* `nil`) - Purchase order (PO) for this billing profile. This PO number is used in the invoices for all of the advertisers in this billing profile.
  *   `secondaryPaymentsCustomerId` (*type:* `String.t`, *default:* `nil`) - The ID of the secondary payment customer the billing profile belongs to. This is a read-only field.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Status of this billing profile.This is a read-only field.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :consolidatedInvoice => boolean() | nil,
          :countryCode => String.t() | nil,
          :currencyCode => String.t() | nil,
          :id => String.t() | nil,
          :invoiceLevel => String.t() | nil,
          :isDefault => boolean() | nil,
          :kind => String.t() | nil,
          :name => String.t() | nil,
          :paymentsAccountId => String.t() | nil,
          :paymentsCustomerId => String.t() | nil,
          :purchaseOrder => String.t() | nil,
          :secondaryPaymentsCustomerId => String.t() | nil,
          :status => String.t() | nil
        }

  field(:consolidatedInvoice)
  field(:countryCode)
  field(:currencyCode)
  field(:id)
  field(:invoiceLevel)
  field(:isDefault)
  field(:kind)
  field(:name)
  field(:paymentsAccountId)
  field(:paymentsCustomerId)
  field(:purchaseOrder)
  field(:secondaryPaymentsCustomerId)
  field(:status)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V4.Model.BillingProfile do
  def decode(value, options) do
    GoogleApi.DFAReporting.V4.Model.BillingProfile.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V4.Model.BillingProfile do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
